package com.mx.project.services.impl;

import com.mx.project.dao.CommentMapper;
import com.mx.project.pojo.Comment;
import com.mx.project.vo.CommentInfo;
import com.mx.project.services.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public int addComment(Comment comment) {
        return commentMapper.insertSelective(comment);
    }

    @Override
    public List<CommentInfo> getCommentByPid(Integer pid) {
        return commentMapper.selectCommentInfoByPid(pid);
    }
}
